package com.sd365.permission.centre.api;

import com.sd365.permission.centre.pojo.vo.CacheInfoVO;
import com.sd365.permission.centre.pojo.vo.KeyValueVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @Version :1.0
 * @PROJECT_NAME: sd365-permission-centre
 * @PACKAGE_NAME:com.sd365.permission.centre.api
 * @NAME: CacheApi
 * @author:xuandian
 * @DATE: 2022/7/9 15:34
 * @description: 缓存监控
 */
@CrossOrigin
@Api(tags = "缓存监控 ", value = "/permission/centre/v1/monitor")
@RequestMapping(value = "/permission/centre/v1/monitor")
public interface CacheApi {
    /**
     * 获取缓存监控Key
     *
     * @return
     */
    @ApiOperation(value = "", tags = "缓存监控key...")
    @GetMapping(value = "/queryCacheInfo")
    CacheInfoVO getCacheInfo(@RequestParam(value = "key", required = false) String key);

    /**
     * 获取缓存监控
     *
     * @return
     */
    @ApiOperation(value = "", tags = "缓存监控value")
    @GetMapping(value = "/queryByKeyCache")
    KeyValueVo queryByKey(@RequestParam(value = "key") String key);

    /**
     * 删除缓存
     *
     * @param key
     * @return
     */
    @ApiOperation(value = "", tags = "删除缓存监控")
    @GetMapping(value = "/deleteByKey")
    Boolean deleteByKey(@RequestParam(value = "key") String key);
}
